$import( "SmitearWebGL.Objects.Parser.Collada.DaeEntity" );
$import( "SmitearWebGL.Objects.Parser.Collada.DaeAsset" );

SmitearWebGL.Objects.Parser.Collada.DaeImage = SmitearWebGL.Objects.Parser.Collada.DaeEntity.extend(
{
	/******** constructor ********/

	init : function( document, node )
	{
		this.init_from = "";
		this.htmlElement = null;

		this._super( document, node );
		this._registClass( "SmitearWebGL.Objects.Parser.Collada.DaeImage" );
	}
	,
	destroy : function()
	{
		this._super();

		this.htmlElement = null;
	}
	,
	read : function( node )
	{
		this._super( node );

		var children = node.childNodes;

		for( var i = 0; i < children.length; i++ )
		{
			var child = children[i];

			switch( child.localName )
			{
				case SmitearWebGL.Objects.Parser.Collada.Const.DAE_ASSET_ELEMENT:
					this.asset = new SmitearWebGL.Objects.Parser.Collada.DaeAsset( this.document, child );
					break;

				case SmitearWebGL.Objects.Parser.Collada.Const.DAE_DATA_ELEMENT:
					break;

				case SmitearWebGL.Objects.Parser.Collada.Const.DAE_INITFROM_ELEMENT:
					this.init_from = unescape( child.childNodes[0].nodeValue );
					this.init_from.split("\\").join("/");
					$LOG( " => " + this.id + " init_from: " + this.init_from );
					break;

				case SmitearWebGL.Objects.Parser.Collada.Const.DAE_EXTRA_ELEMENT:
					break;

				default:
					break;
			}
		}
	}
}
);
